import React from "react"

function fn(Com) {
    return ({ count, num, list }) => {
        return (newCount) => {
            return class NewCom extends React.Component {
                state = {
                    count,
                    num,
                    list
                }
                add = () => {
                    this.setState({
                        count: this.state.count += newCount
                    })
                }
                render() {
                    const { count } = this.state
                    return <div>
                        <Com count={count} add={this.add} />
                    </div>
                }
            }
        }
    }
}


export {
    fn
}




// function add(a) {
//     return (b) => {
//         return a + b
//     }
// }


// add(10)(20)

